package v3.object.command.list;

import java.util.Map;

import text.TextUtil;
import v3.object.STcfg;
import v3.object.command.aCommand;
import v3.object.command.iCommand;
import v3.object.command.servoCommand.OnScreen;
import v3.object.command.servoCommand.servoCommand;
import v3.object.ship.Ship;
import v3.object.space.Universe;

public class Log extends servoCommand
{
	
	public Log()
	{
		super();
		commandName="COMPUTER LOG";
	}

	@Override
	public boolean realExecute(STcfg cfg, Universe universe, Ship ship, Map<String, iCommand> commands, String[] input)
	{
		StringBuilder sb = new StringBuilder();
		int index=0;
		for(double d : ship.getCptLong().keySet())
		{
			sb.append(TextUtil.append(index,"\t",format_decimal.format(d)," -> ",ship.getCptLong().get(d),"\n"));
			index++;
		}
		
		iCommand c = new OnScreen(commandName, sb.toString());
		c.execute(cfg, universe, ship, commands, input);
		return true;
	}




}
